package com.mmren.edu.dtx.mapper;

import com.mmren.edu.dtx.domain.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

/**
 * 欢迎来到牧码人教育，做Java我们是专业的
 *
 * @创建人： 牧码人教育-Gerry
 * @创建时间： 2020-4-20
 * @功能描述：
 */
@Component
@Mapper
public interface OrderMapper {
    /**
     * 插入订单接口
     * @param order
     * @return
     */
    @Insert("insert into t_order(order_id, product_id, user_id, payment_amount, state)" +
            "values(#{order.orderId},#{order.productId},#{order.userId}," +
            "#{order.paymentAmount},#{order.state})")
    int insertOrderInfo(@Param("order")Order order);
}
